Enhancements to CLI: AI Workflow Integration, Storage Options, and Bug Fixes#245
Merged
Conversation
- Added path attribute to Command model for origin directory tracking - Ensure directory paths are Windows compatible in command content - Capture and store the command's origin file path in parsing process
- Add explicit handling for openai.APIError in CLI error handling - Use logger to log the exception and echo error type to stderr - Ensure a non-zero exit code on encountering openai.APIError
- Added command_runner.py with AI to auto-generate workflow parameters - Implemented router.py to handle command routing and execution - Enhanced engine init to include the new run_command function
- Introduced a flag to decide if AI responses should be stored - Implemented conditional storage based on the new flag - Refactored stream response handling to align with conditional storage
- Added datetime import to handle lack of timestamp in prompts - Modified prompt formatting to prevent crash without hash - Removed raising ValueError for missing timestamp and hash
- Removed redundant environment and parameter initializations. - Centralized command execution error handling and environment management. - Enhanced readability and maintainability by isolating LLM function call logic.
- Removed auto selection logic for workflow execution - Shifted the selection logic to be managed by workflows externally - Cleaned up redundant codes and streamlined command processing flow
- Moved __make_function and __select_function_by_llm to ToolUtil class - Introduced CommandUtil and ToolUtil classes in util.py - Slimmed down command_runner.py by abstracting utility functions
- Removed unused `openai` import in command_runner.py - Adjusted spacing for readability and compliance with PEP8 - Enforced method signature alignment in util.py for better readability
- Introduced MissContentInPromptException for better error messages - Refactored before_prompt to improve readability and modularity - Enhanced workflow prompt processing with new loading function
- Removed redundant error logging to stderr - Ensured model_name, parent_hash, and history_messages are non-empty - Updated environment variable handling for better robustness
- Implemented auto-copy of devchat dependency packages to the tools directory for local package environment verification. - Updated dependencies in poetry.lock to include new versions and additional packages such as tenacity, pathspec, and importlib-resources. - Modified pyproject.toml to reflect the updated version of pydantic and added new dependencies for better environment verification support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a suite of improvements to the command-line interface, focusing on integrating AI-driven workflows, handling storage conditions for AI responses, improving error handling, and fixing bugs encountered with time mismatches and response settings.
Key Changes:
command_runner.pymodule and enhancements to the engine initialization process.In addition to these features, several minor tweaks have been made, such as updating timeout values, introducing environment variables for managing cache directories, and ensuring non-storage response settings are handled appropriately.
These changes aim to enhance the user experience by making the CLI more reliable, versatile, and easy to use.